﻿using UnityEngine;

public class PlayerInputManger : MonoBehaviour
{
    /// <summary>
    /// 虚拟摇杆上摇
    /// </summary>
    public void RockerUp()
    {
        if (PlayerStateManger.instance.mCurGamePlayerMode.PlayerCurrentStateType == PlayerState.WalkUp)
        {
            return;
        }

        PlayerStateManger.instance.ChangePlayerMode(PlayerState.WalkUp);
    }

    /// <summary>
    /// 虚拟摇杆上摇
    /// </summary>
    public void RockerDown()
    {
        if (PlayerStateManger.instance.mCurGamePlayerMode.PlayerCurrentStateType == PlayerState.WalkDown)
        {
            // Debug.Log(mCurGamePlayerMode.PlayerCurrentStateType);
            return;
        }

        PlayerStateManger.instance.ChangePlayerMode(PlayerState.WalkDown);
    }

    /// <summary>
    /// 虚拟摇杆左摇
    /// </summary>
    public void RockerLeft()
    {
        if (PlayerStateManger.instance.mCurGamePlayerMode.PlayerCurrentStateType == PlayerState.WalkLeft)
        {
            return;
        }

        PlayerStateManger.instance.ChangePlayerMode(PlayerState.WalkLeft);
    }

    /// <summary>
    /// 虚拟摇杆右摇
    /// </summary>
    public void RockerRight()
    {
        if (PlayerStateManger.instance.mCurGamePlayerMode.PlayerCurrentStateType == PlayerState.WalkRight)
        {
            return;
        }

        PlayerStateManger.instance.ChangePlayerMode(PlayerState.WalkRight);
    }

    /// <summary>
    /// 跳跃按钮
    /// </summary>
    public void JumpButton()
    {
      
       
            PlayerStateManger.instance.ChangePlayerMode(PlayerState.Jump);
        
       
    }
    /// <summary>
    ///虚拟摇杆归位 
    /// </summary>
    public void RockerReset()
    {
        PlayerStateManger.instance.ChangePlayerMode(PlayerState.Idle);
    }
}